<template>
  <div class="child">
    <h2>我是Child组件</h2>
    <h3>我拥有一个玩具:{{toy}}</h3>
    <button @click="sendToy(toy)">把玩具给爹玩玩</button>
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['sendToy'],
    data() {
        return {
            toy:'奥特曼'
        }
    },
  }
</script>

<style scoped>
    .child {
        background-color: skyblue;
        padding: 20px;
    }
</style>